﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EyFramework.Common;
using HzybService.BaseOutData;
using YbService.Core.Core.Service;
using YbService.Core.Entity;

namespace HzybService
{
    public class DataSaveService
    {
        private static IHzybDzpzjyjlService dzpzjyjlService = Globals.GetService<IHzybDzpzjyjlService>();

        public static bool SaveDzpzJsjl(BaseInData.RcFeiYong feiYong, FeiYongJs jsFeiYong)
        {
            HzybDzpzjyjl hzybDzpzjyjl = new HzybDzpzjyjl()
            {
                JIESUANID = dzpzjyjlService.GetHisMaxId("HZYB_DZPZ_JYJL", "JIESUANID"),
                BINGRENID = feiYong.BingRenId,
                CAOZUOYUAN = feiYong.CaoZuoYuanDm,
                JIUZHENLSH = feiYong.JiuZhenLsh,
                DANJUHAO = feiYong.DanJuHao,
                YILIAOLB = feiYong.YiLiaoLb,
                JIESUANRQ = feiYong.JieSuanRq,
                CHUYUANRQ = feiYong.ChuYuanRq,
                CHUYUANYY = feiYong.ChuYuanYy,
                CHUYUANJBBM = feiYong.ChuYuanJbbm,
                CHUYUANJBMC = feiYong.ChuYuanJbmc,
                CHIYAOZD1 = feiYong.ChiYaoZdbm1,
                CHIYAOZD2 = feiYong.ChiYaoZdbm2,
                CHIYAOZD3 = feiYong.ChiYaoZdbm2,
                CHIYAOZD4 = feiYong.ChiYaoZdbm2,
                CHIYAOZD5 = feiYong.ChiYaoZdbm2,
                CHIYAOZD6 = feiYong.ChiYaoZdbm2,
                CHIYAOZD7 = feiYong.ChiYaoZdbm2,
                CHIYAOZD8 = feiYong.ChiYaoZdbm2,
                CHIYAOZD9 = feiYong.ChiYaoZdbm2,
                CHIYAOZD10 = feiYong.ChiYaoZdbm2,
                CHIYAOZD11 = feiYong.ChiYaoZdbm2,
                CHIYAOZD12 = feiYong.ChiYaoZdbm2,
                CHIYAOZD13 = feiYong.ChiYaoZdbm2,
                CHIYAOZD14 = feiYong.ChiYaoZdbm2,
                JINGBANREN = feiYong.JinBanRen,
                BEIANHAO = feiYong.BeiAnHao,
                GERENBH = feiYong.GeRenBh,
                YIYUANJYLSH = feiYong.YiYuanJylsh,
                ZHONGXINJYLSH = jsFeiYong.ZhongXinJylsh,
                FEIYONGZE = Convert.ToDecimal(feiYong.FeiYongZe),
                BCXJZF = jsFeiYong.BenCiXjzf,
                BENNIANZHYE = jsFeiYong.BenNianZhye,
                LINIANZHYE = jsFeiYong.LiNianZhye,
                YEWUZQH = feiYong.YeWuZqh
            };

            return dzpzjyjlService.Insert(hzybDzpzjyjl);
        }
    }
}